﻿using System;
using StockholmsStad.Windows.UI.Infrastructure;

namespace StockholmsStad.Windows.UI.Models
{
    internal static class ApplicationModel
    {
        private static string versionText;

        public static string VersionTextAsDateTime
        {
            get
            {
                if (versionText == null)
                {
                    var ver = VersionHelper.Version;
                    versionText = ver == null ? String.Empty : String.Format("v{0}.{1} (Bygge {2})",
                                                                             ver.Major, ver.Minor,
                                                                             VersionHelper.GetBuildRevisionAsDateTime(ver));
                }
                return versionText;
            }
        }

        public static string MajorVersion
        {
            get { return VersionHelper.AssemblyMajorVersion; }
        }

        public static string FrameworkVersion
        {
            get
            {
                return System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
            }
        }

        public static string FrameworkDirectory
        {
            get
            {
                return System.Runtime.InteropServices
                    .RuntimeEnvironment.GetRuntimeDirectory();
            }
        }

        public static string FullVersionNumber
        {
            get
            {
                return VersionHelper.AssemblyVersion;
            }
        }
    }
}